int rc = 1, i, n, k;
unsigned long mfn, pfn, xpfn;
unsigned int prev_pc, this_pc;
- u32 dom = ioctxt->domain;
+ u32 dom = 0;
int verify = 0;
/* Number of page frames in use by this Linux session. */
return 1;
}
- /* Start writing out the saved-domain record. */
+ /* Start reading the saved-domain record. */
if ( xcio_read(ioctxt, signature, 16) ||
(memcmp(signature, "LinuxGuestRecord", 16) != 0) )
{
goto out;
}
+#if 0
/* Set the domain's name to that from the restore file */
if ( xc_domain_setname( xc_handle, dom, name ) )
{
dom, nr_pfns,nr_pfns * (PAGE_SIZE / 1024));
goto out;
}
+#endif
+
+
+ /* XXX create domain on CPU=-1 so that in future it auto load ballances by default */
+ if ( xc_domain_create( xc_handle, nr_pfns * (PAGE_SIZE / 1024),
+ name,
+ -1, &dom ) )
+ {
+ xcio_error(ioctxt, "Could not create domain. pfns=%d, %dKB",
+ nr_pfns,nr_pfns * (PAGE_SIZE / 1024));
+ goto out;
+ }
+
+ ioctxt->domain = dom;
+ printf("Created domain %ld\n",dom);
/* Get the domain's shared-info frame. */
op.cmd = DOM0_GETDOMAININFO;
def domain_exists(self, name):
name = str(name)
- return self.domain_by_name.get(name) or self.domain_by_id.get(name):
+ return self.domain_by_name.get(name) or self.domain_by_id.get(name)
def domain_unpause(self, id):
"""Unpause domain execution.
# When creating or rebooting, a domain with my name should not exist.
# When restoring, a domain with my name will exist, but it should have
# my domain id.
- if dominfo and (not self.dom or dominfo.dom != self.dom)
+ if dominfo and (not self.dom or dominfo.dom != self.dom):
raise VmError('vm name clash: ' + name)
def construct(self, config):